package sjtu.pirate.report.frame;

import java.io.IOException;
import java.util.Date;
import biz.source_code.miniTemplator.MiniTemplator.TemplateSyntaxException;
import sjtu.pirate.analyzer.PirateAnalyzer;
import sjtu.pirate.report.ReportTemplate;
/**
 * @author wilbur.ma@qq.com
 * @date 2011.06.01
 */
public class OverviewTemplate extends ReportTemplate {
	public OverviewTemplate(String templateFile, String reportDir, PirateAnalyzer analyzer) 
			throws TemplateSyntaxException, IOException {
		super(templateFile, reportDir, "/overview.html", analyzer);
	}

	@Override
	protected void setTemplateParams() {
		setVar("current_date", new Date().toString());
		setVar("sites_num", analyzer.getResults().size());
		setVar("fail_sites_num", analyzer.getFailSitesNum());
		setVar("forms_num", analyzer.getAllFormsNum());
		setVar("fail_forms_num", analyzer.getAllFailFormsNum());
		setVar("cases_num", analyzer.getAllCasesNum());
		setVar("fail_cases_num", analyzer.getAllFailCasesNum());
	}
}
